Gluing sheaves